<!DOCTYPE html>
<html>
<head>
    <title>排班表</title>
    <style>
        table {
            border-collapse: collapse;
            width: 100%;
            table-layout: auto;
            font-size: 13px;
        }
        th, td {
            border: 1px solid black;
            padding: 4px;
            text-align: center;
            word-wrap: break-word;
            overflow-wrap: break-word;
            min-width: 76px; /* 可以根据需要调整最大宽度 */
        }
        th {
            background-color: #f2f2f2;
        }
        tbody tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        tbody tr:hover {
            background-color: #e0e0e0;
        }
    </style>
</head>
<body>
<h1>排班表</h1>
<table>
    <thead>
    <tr>
        <th>&nbsp;</th>
        <#list weeks as week>
            <th>${week}</th>
        </#list>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td><strong>姓名</strong></td>
        <#list dates as date>
            <td>${date}</td>
        </#list>
    </tr>
    <#list allSchedule?keys as user>
        <tr>
            <td>${user}</td>
            <#list dates as date>
                <#assign status = allSchedule[user][date]?string!"" />
                <td>
                    <#if status == "休息">
                        <span style="color: red;">${status}</span>
                    <#else>
                        ${status}
                    </#if>
                </td>
            </#list>
        </tr>
    </#list>
    </tbody>
</table>
</body>
</html>